package day0723;

import javax.swing.*;
import java.util.Random;

public class Airplane extends FlyingObject {

    Airplane() {
        Random r=new Random();
        int n=r.nextInt(420);
        x = n;
        y = 0;
        ImageIcon bgIcon = new ImageIcon("images1/airplane0.png");
        airplaneImage = bgIcon.getImage();
        height = bgIcon.getIconHeight();
        width = bgIcon.getIconWidth();
    }

    void fly() {
        y += 5;
    }

    boolean outofbounds() {
        return y > GamePane.height;
    }
}
